<template>
    <div class="comment">
        <span class="leancloud-visitors" data-flag-title="Your Article Title">
            <em class="post-meta-item-text">阅读量： </em>
            <i class="leancloud-visitors-count"></i>
        </span>
        <div id="vcomments"></div>
    </div>
</template>

<script>
import Valine from 'valine'
export default {
    name: 'Valine',
    mounted() {
        if (typeof window !== 'undefined') {
        	document.getElementsByClassName('leancloud-visitors')[0].id = window.location.pathname;
            this.window = window;
            window.AV = require('leancloud-storage')
        }
        new Valine({
            el: '#vcomments',
            appId: 'bkkgvYHpnPtbVkPpHBm33i5D-gzGzoHsz',
            appKey: 'krRK3KC97PfwKgms4RuxWU9m',
            notify: false,
            verify: false,
            avatar: 'yw00yw',
            placeholder: '请输入留言内容',
            visitor: true // 开启阅读量
        })
    }
}
</script>

<style>
    #vcomments {
        margin-top: 60px;
    }
</style>
